#pragma once

#include <stddef.h>

uint64_t time_usec(void);

class TicToc {
public:
    TicToc(){
        tic();
    }
    void tic() {
        ts = time_usec();
    }
    uint64_t toc() {
        return time_usec() - ts;
    }
    uint64_t ts;
};


int load_image(const char *filename, void *img_data, size_t size);
int load_image(const char *filename, void *img_data, int &h, int &w, int &stride);
void save_image(const char *filename, void *img_data, int h, int w, int stride);



void test_cv(const char *filename, int height, int width, int stride, int loops, uint64_t *t);